package com.yanqu.road.entity.smallgame;


import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.List;

@FieldTypeAnnotation(tableName = "t_u_smallgame_stage", autoSave = true)
public class UserSmallGameStageData extends DataObject {

    @FieldTypeAnnotation(desc = "用户Id", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "关卡类型")
    private int type;

    @FieldTypeAnnotation(desc = "关卡已通关等级")
    private List<Integer> stageLevelPass;

    @FieldTypeAnnotation
    private long modifyTime;

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public long getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(long modifyTime) {
        if (this.modifyTime != modifyTime) {
            this.modifyTime = modifyTime;
            this.setUpdateOption();
        }
    }

    public List<Integer> getStageLevelPass() {
        return stageLevelPass;
    }

    public void setStageLevelPass(List<Integer> stageLevelPass) {
        this.stageLevelPass = stageLevelPass;
    }

    public void addStageLevelPass(int level) {
        stageLevelPass.add(level);
        this.setUpdateOption();
    }
}
